{template 'common/header'}
{if IMS_VERSION<1}
    <link href="{MODULE_URL}/template/static/css/wq1.0.css" rel="stylesheet">
{/if}
<style>

    .setvotestatus{cursor:pointer;}
    .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{
        white-space: normal;
        word-wrap: break-word;
    }
</style>
<div class="main1">
    <div class="we7-page-title">设置管理员</div>
    <table class="table we7-table table-hover">
        <thead class="navbar-inner">
        <tr>
            <th>openid</th>
            <th width="100">头像</th>
            <th>昵称</th>
            <th>是否管理员</th>
            <th>当前所属分组</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {loop $list $row}
            <tr>
                <td class="text-left vertical-middle">{$row['oauth_openid']}</td>
                <td class="text-left vertical-middle"><img src="{$row['avatar']}" width="48"></td>
                <td>{$row['nickname']}</td>
                <td class="text-left vertical-middle">
                    {if $row['is_leader'] == 1} 是 {else} 否{/if}
                <td class="text-left vertical-middle">{$row['group']}</td>
                <td class="text-left vertical-middle">
                    {if $row['is_leader'] == 0}
                        <a onclick="drop_confirm('确定要设置为管理员?','{php echo $this->createWebUrl('add_leader')}',{$row['id']})">设为管理员</a>
                    {/if}
                </td>
            </tr>
        {/loop}
        </tbody>
    </table>
    <div class="pull-right">
        {$pager}
    </div>
    <script>
        function drop_confirm(msg, url,id){
            if (confirm(msg)){
                $.post(url,{uid:id}, function(data){
                    if (data.message.errno == 1)
                    {
                        location.reload();
                    } else {
                        alert(data.message.message);
                    }

                }, 'json');
            }
        }
    </script>

{template 'common/footer'}